package com.whx.authorization.request;

import com.whx.authorization.response.RegisterSubSystemResponse;
import org.jsoup.Connection;

/**
 * 类名：RegisterSubSystemRequest
 * 类路径： com.whx.authorization.request.RegisterSubSystemRequest
 * 创建者： whx
 * 创建时间： 10/9/18 3:43 PM
 * 项目： authorization_center
 * 描述：
 */
public class RegisterSubSystemRequest extends BaseRequest<RegisterSubSystemResponse> {

    private String session;

    private String logoutUrl;

    private String logoutParam;

    private String cookieString;

    private String httpMethod;

    public String getMethodPath() {
        return "authorization/registerSubSystem";
    }

    public Class<RegisterSubSystemResponse> getResponseClass() {
        return RegisterSubSystemResponse.class;
    }

    @Override
    public Connection.Method getHttpMethod() {
        return Connection.Method.POST;
    }

    protected void addParams() {
        putParam("logoutUrl", logoutUrl);
        putParam("logoutParam", logoutParam);
        putParam("cookieString", cookieString);
        putParam("httpMethod", httpMethod);
    }

    protected void addCookies() {
        putCookieParam(AUTHORIZATION_CENTER_SESSION_NAME, session);
    }

    protected void addHeaders() {
        putHeaderParam("AuthorizationType0", "registerSubSystem");
    }

    public String getSession() {
        return session;
    }

    public void setSession(String session) {
        this.session = session;
    }

    public String getLogoutUrl() {
        return logoutUrl;
    }

    public void setLogoutUrl(String logoutUrl) {
        this.logoutUrl = logoutUrl;
    }

    public String getLogoutParam() {
        return logoutParam;
    }

    public void setLogoutParam(String logoutParam) {
        this.logoutParam = logoutParam;
    }

    public String getCookieString() {
        return cookieString;
    }

    public void setCookieString(String cookieString) {
        this.cookieString = cookieString;
    }

    public void setHttpMethod(String httpMethod) {
        this.httpMethod = httpMethod;
    }
}
